A computer graphics display system allows displays of graphical images on pixel-oriented output devices. FIG. 1 is a simplified, semi-schematic block diagram of one such exemplary system. As illustrated in FIG. 1, the system comprises a processor 10, a frame buffer 12, a display monitor 14, and a display controller 16. The display monitor 14 includes a screen which displays a plurality of pixels. A pixel is generally the smallest addressable element in an electronic display. Individual pixels on a screen are addressed using x and y coordinates, in a similar manner as points on a graph or matrix are addressed. Frame buffer 12 resides in main memory 18 and stores a pixel number map corresponding to a graphical image. The pixel number map can be represented by a grid-like (or matrix-like) array of pixels where each pixel is assigned a color and a shade value.
When designing a display system, it is important to consider the human eye. The human eye has three types of photoreceptor cells called cones. Each of the three types of cones responds differently to light of different wavelengths. Accordingly, light with different wavelength content is perceived as light of different color. Color display systems have existed for a long time with knowledge of how human perception works; however, the manner of displaying colors on electronic systems continues to develop.
A basic color display system uses an RGB color system. In such a system, R corresponds to a red color source, G to a green color source and B to a blue color source. By selecting the wavelength content of the RGB color sources, a color gamut is achieved. Thus by blending or combining different amounts of either the red, green, or blue source, a wide range of colors can be achieved. From this color gamut, it is therefore important to mathematically represent a color from a set of colors. Such mathematical representation is called a color space.
RGB is an additive color system where the three primary colors red, green, and blue are added to form a desired color. In a typical RGB color space each component has a range of 0 to 255. When the three sources are at zero, the resulting color is black; when the three sources are at 255, the resulting color is white.
For an RGB color system, an RGB color space can be used. There are, however, other color spaces available including YIQ, YUV, YCbCr, and CMYK. Mathematical conversions are available to convert from one color space to another. Of particular interest in the present invention, is the YCbCr color space which is commonly used in broadcast and television systems as well as computer graphics implementations.
Different color spaces have historically evolved for different applications. In each case, a color space was chosen for reasons that may no longer be applicable. A choice may have been made on a particular color space because certain mathematical elements were simpler or faster to process. A choice may have been made because of reduce memory requirements or because of reduced bandwidth on digital buses.
With regard to the YCbCr color space, it was developed as part of the Recommendation ITU-R BT.601 as a worldwide digital component video standard and is used in television transmissions. YCbCr is a scaled and offset version of the YUV color space where Y represents luminance (or brightness), U represents color, and V represents the saturation value. In the YCbCr color space, the RGB color space is separated into a luminance part, Y, and two chrominance parts, Cb and Cr. A historical reason for choosing YCbCr over RGB is that YCbCr reduces storage and bandwidth requirements.
In developing the YCbCr color space, it was considered that the human eye is more sensitive to change in brightness than change in color. Engineers found that 60 to 70 percent of luminance or brightness is found in the “green color.” Accordingly, in the chrominance parts, Cb and Cr, the brightness information can be removed from the blue and red colors.
To generate the same color in the RGB format, all three color components should be of equal bandwidth. This requires more storage space and bandwidth. Also, processing an image in the RGB space is more complex since any change in the color of any pixel requires all the three RGB values to be read, calculations performed, and then stored. However, the color information is stored in the intensity and color format, some of the processing steps can be made faster. The result is that Cb and Cr provide the hue and saturation information of the color and Y provides the brightness information of the color. Y is defined to have a range of 16 to 235 and Cb and Cr have a range of 16 to 240 with 128 equal to zero. Because the human eye is less sensitive to Cb and Cr, engineers did not need to transmit Cr and Cb at the same rate as Y. Less storage and bandwidth was needed, resulting in reduced design costs.
Thus, where storage and bandwidth are a design consideration, as in many modem digital graphic systems, the YCbCr color space is preferred. Within the YCbCr color space there are various formats including the 4:4:4, 4:2:2, 4:1:1, and the 4:2:0 formats. These various formats provide different levels of compression with certain tradeoffs. The 4:2:0 format, in particular, provides certain compression advantages, but because of the manner in which it is implemented, memory bandwidth becomes a problem. Display systems that implement the 4:2:0 format typically use paged memory devices (e.g., SRAM or DRAM) where the Y, Cb, and Cr information are stored in different pages of memory. Moreover, a typical system retrieves information for two pixels at a time by retrieving two items of Y information, and one item each of Cb and Cr information. Thus, retrieving color information for a pair of pixels in a prior art system, requires three page breaks. It is therefore desirable to provide a computer display system that provides improved memory bandwidth. It is further desirable to provide a computer display system that reduces the number of required memory page breaks to display an image.
Returning to the discussion of FIG. 1, processor 10 computes and updates the pixel values in frame buffer 12 when a new graphical image is to be displayed. During the display process, display controller 16 acts as an interface between frame buffer 12 and display monitor 14 by taking the pixel values in frame buffer 12 and converting them to a video signal for rendering on display 14.
In processing a three-dimensional graphical object, the depth attribute, often called a z-value, of the object must be considered prior to the updating of any pixel values in frame buffer 12. Consider that if the new object being processed is located behind and is partially obscured by the displayed object, only a visible portion of the new object should be displayed. But if the new object is completely obscured by the displayed object, no updates to frame buffer 12 are necessary and the new object is not rendered on display 14.
Three-dimensional objects are often represented by a set of vertices defining polygonal surfaces. Each vertex is defined by its x, y, and z dimensions corresponding to abstract X-, Y-, and Z-axes. Notably, the X- and Y-axes define a view plane and the Z-axis represents a distance from the view plane. A z-coordinate value, therefore, indicates a depth of an object at a pixel location defined by specific x and y coordinates. Generally speaking, it represents a distance from a viewpoint such as an abstract distance from a person viewing display 14.
Further referring to FIG. 1, z-buffer 20 is configured to store z-values for each pixel, that is, the depth value of each pixel. With these z-values a depth analysis of a three-dimensional object can be performed. This analysis is often referred to as a hidden surface removal process. Because hidden surfaces will not be rendered on display 14, they can be removed from consideration. For example, when a new object moves into a displayed portion of a view plane, a determination is to be made as to whether the new object is visible and should be displayed, or whether the new object is hidden by objects already in the displayed portion of the view plane such that it will not be displayed. Prior art systems have generally made a determination of whether a new object should be displayed on a pixel-by-pixel basis. Thus, for each pixel to be rendered, defined by its x, y coordinates, the depth (i.e., z-value) of the new object is compared to the depth (i.e., z-value) of the currently displayed object.
For example, if a comparison indicates that the new pixel to be drawn is in front of the old pixel in z-buffer 20 (i.e., the new z-value is less than the old z-value), the old z-value is replaced with the new z-value, and the color system (e.g., RBG or YCbCr) parameters for the new pixel are written to frame buffer 12 for display in the place of the old pixel. Conversely, if the new pixel is located behind the old pixel (i.e., the new z-value is greater than the old z-value), it will be hidden from view and need not be displayed. In this situation, the old z-value is kept in the z-buffer and the new z-value is discarded. That is, the old pixel remains displayed and is not replaced by the new pixel.
There are several disadvantages to the above prior art process. First, initializing each pixel in z-buffer 20 to a constant value (generally the value of the background) is expensive in terms of time and memory bandwidth. Furthermore, the pixel-by-pixel analysis during the display of an object requires a z-buffer read for each pixel to compare the z-value of the old pixel with respect to the new pixel. Because z-buffers are large and cannot be stored on-chip, thereby requiring external memory access, z-comparisons significantly slow down the rendering process. In addition, significant computational cycles are expended in performing pixel-by-pixel comparisons. Accordingly, there is a need for a system and method for computer graphics generation and display that will perform hidden surface removal with less computation cycles and memory bandwidth waste.